/**
 * GenericComponentsAction.java
 *
 * Copyright (c) 2010 Prj.Manager All Rights Reserved.
 *
 * This source file may not be copied, modified or redistributed,
 * in whole or in part, in any form or for any reason, without the express
 * written consent of Prj.Manager .
 **/
package ro.prjmanager.web.actions;

import ro.prjmanager.core.annotations.*;
import ro.prjmanager.model.GenericComponents;
import ro.prjmanager.web.annotation.NomenclatorTarget;
import ro.prjmanager.web.annotation.Service;

@Service(target = "genericcomponentsService")
@NomenclatorTarget(addTarget = "add",deleteTarget = "del",editTarget = "edit",
        resource = "/pages/nomenclators/genericcomponents/genericcomponents.jsp",
        onFaildReturn = "/pages/nomenclators/genericcomponents/genericcomponents.jsp")
@List(serviceName = "genericcomponentsService",
        caption = "GenericComponents List",
        editUrl = "%context_path%/actions/GenericComponents.action",
        id = "1", height = 200, rowNum = 10,
        url = "%context_path%/genericcomponents.lst")
public class GenericComponentsAction extends GenericAction<GenericComponents> {

    @Id
    private Long idL;

    @Column(name = "name", caption = "Nume", index = "name", width = 100, editOptions = @EditOptions(pos = 2   ))
    private java.lang.String name;

    @Column(name = "description", caption = "Descriere", index = "description", width = 100, editOptions = @EditOptions(pos = 3   ))
    private java.lang.String description;

    @Column(name = "relativePackage", caption = "Pachet relativ", index = "relativePackage", width = 100, editOptions = @EditOptions(pos = 4  ,cols = 20, rows = 4, edittype = "textarea" ))
    private java.lang.String relativePackage;

    @Column(name = "fkProjectLayer", caption = "Layer proiect", index = "fkProjectLayer", width = 100, editOptions = @EditOptions(pos = 5  ,edittype = "select",size = 1 ))
    @SelectOption(id="fkProjectLayer",serviceName = "projectlayersService")
    private java.lang.Integer fkProjectLayer;

    @Column(name = "fkTemplate", caption = "Template", index = "fkTemplate", width = 100, editOptions = @EditOptions(pos = 6  ,edittype = "select",size = 1 ))
    @SelectOption(id="fkTemplate",serviceName = "templateService")
    private java.lang.Integer fkTemplate;

    @Column(name = "fkFixedComponents", caption = "Componenta fixa", index = "fkFixedComponents", width = 100, editOptions = @EditOptions(pos = 7  ,edittype = "select",size = 1 ))
    @SelectOption(id="fkFixedComponents",serviceName = "fixedcomponentsService")
    private java.lang.Integer fkFixedComponents;


    @Column(name = "suffix", caption = "Suffix", index = "suffix", width = 100, editOptions = @EditOptions(pos = 8  ,cols = 20, rows = 4, edittype = "textarea" ))
    private java.lang.String suffix;

    @Column(name = "res", caption = "Resource", index = "res", width = 50, editOptions = @EditOptions(pos = 9 ,edittype = "checkbox",value = "1:0",defaultValue = "0"  ))
    private java.lang.Integer res;

    @Column(name = "web", caption = "Web", index = "web", width = 50, editOptions = @EditOptions(pos = 10 ,edittype = "checkbox",value = "1:0",defaultValue = "0"  ))
    private java.lang.Integer web;

    public Long getIdL() {
        if(getId()!=null&&!getId().isEmpty()&&!getId().equals("_empty"))
          idL=Long.valueOf(getId());
        return idL;
    }

    public void setIdL(Long idL) {
        this.idL = idL;
        if(idL!=null)
            this.setId(String.valueOf(idL));
    }

    /**
     * This method gets the name attribute
     * @return - an  java.lang.String  object
     **/
    public  java.lang.String  getName(){
        return this.name;
    }

    /**
     * The setter for the name attribute
     * @param name -  an  java.lang.String  object
     **/
    public void setName( java.lang.String  name){
        this.name=name;
    }
    /**
     * This method gets the description attribute
     * @return - an  java.lang.String  object
     **/
    public  java.lang.String  getDescription(){
        return this.description;
    }

    /**
     * The setter for the description attribute
     * @param description -  an  java.lang.String  object
     **/
    public void setDescription( java.lang.String  description){
        this.description=description;
    }
    /**
     * This method gets the relativePackage attribute
     * @return - an  java.lang.String  object
     **/
    public  java.lang.String  getRelativePackage(){
        return this.relativePackage;
    }

    /**
     * The setter for the relativePackage attribute
     * @param relativePackage -  an  java.lang.String  object
     **/
    public void setRelativePackage( java.lang.String  relativePackage){
        this.relativePackage=relativePackage;
    }
    /**
     * This method gets the fkProjectLayer attribute
     * @return - an  java.lang.Integer  object
     **/
    public  java.lang.Integer  getFkProjectLayer(){
        return this.fkProjectLayer;
    }

    /**
     * The setter for the fkProjectLayer attribute
     * @param fkProjectLayer -  an  java.lang.Integer  object
     **/
    public void setFkProjectLayer( java.lang.Integer  fkProjectLayer){
        this.fkProjectLayer=fkProjectLayer;
    }
    /**
     * This method gets the fkTemplate attribute
     * @return - an  java.lang.Integer  object
     **/
    public  java.lang.Integer  getFkTemplate(){
        return this.fkTemplate;
    }

    /**
     * The setter for the fkTemplate attribute
     * @param fkTemplate -  an  java.lang.Integer  object
     **/
    public void setFkTemplate( java.lang.Integer  fkTemplate){
        this.fkTemplate=fkTemplate;
    }
    /**
     * This method gets the fkFixedComponents attribute
     * @return - an  java.lang.Integer  object
     **/
    public  java.lang.Integer  getFkFixedComponents(){
        return this.fkFixedComponents;
    }

    /**
     * The setter for the fkFixedComponent attribute
     * @param fkFixedComponents -  an  java.lang.Integer  object
     **/
    public void setFkFixedComponents( java.lang.Integer  fkFixedComponents){
        this.fkFixedComponents=fkFixedComponents;
    }
    /**
     * This method gets the suffix attribute
     * @return - an  java.lang.String  object
     **/
    public  java.lang.String  getSuffix(){
        return this.suffix;
    }

    /**
     * The setter for the suffix attribute
     * @param suffix -  an  java.lang.String  object
     **/
    public void setSuffix( java.lang.String  suffix){
        this.suffix=suffix;
    }

    public Integer getRes() {
        return res;
    }

    public void setRes(Integer res) {
        this.res = res;
    }

    public Integer getWeb() {
        return web;
    }

    public void setWeb(Integer web) {
        this.web = web;
    }

    public void add() {
        GenericComponents adderObj=getModel();
        getService().create(adderObj);

    }
    public void edit() {
         GenericComponents editObj=getModel();
        getService().update(editObj);
    }

}
